import request from '@/config/axios'

// PI 巡查异常处理档案分类 VO
export interface ProcessingCategoryVO {
  id: number // 编号
  name: string // 名字
  parentId: number // 父级编号
  sort: number // 排序
}

// PI 巡查异常处理档案分类 API
export const ProcessingCategoryApi = {
  // 查询PI 巡查异常处理档案分类列表
  getProcessingCategoryList: async (params) => {
    return await request.get({ url: `/pi/processing-category/list`, params })
  },

  // 查询PI 巡查异常处理档案分类详情
  getProcessingCategory: async (id: number) => {
    return await request.get({ url: `/pi/processing-category/get?id=` + id })
  },

  // 新增PI 巡查异常处理档案分类
  createProcessingCategory: async (data: ProcessingCategoryVO) => {
    return await request.post({ url: `/pi/processing-category/create`, data })
  },

  // 修改PI 巡查异常处理档案分类
  updateProcessingCategory: async (data: ProcessingCategoryVO) => {
    return await request.put({ url: `/pi/processing-category/update`, data })
  },

  // 删除PI 巡查异常处理档案分类
  deleteProcessingCategory: async (id: number) => {
    return await request.delete({ url: `/pi/processing-category/delete?id=` + id })
  },

  // 导出PI 巡查异常处理档案分类 Excel
  exportProcessingCategory: async (params) => {
    return await request.download({ url: `/pi/processing-category/export-excel`, params })
  },
}